function trim(str) {
	if (str == null) return null;
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

//paginator implimentation
var Paginator = new Object();
Paginator.store = function(url,params,callback) {
	AjaxPaginatorHelper.store(url,params,callback);
}

Paginator.updateParams = function(params) {
	AjaxPaginatorHelper.updateParams(params);
}

Paginator.go = function(pageNo) {
	//alert(pageNo);
	this.pageNo = pageNo;
	AjaxPaginatorHelper.send(pageNo);
}

Paginator.setPageTotal = function(total) {
	this.total = total;
}

Paginator.displayNav  = function(resetPaginationFunction) {
	resetPaginationFunction(this.pageNo,this.total);
}

//determines the browser window dimensions
window.size = function() {
	var w = 0;
	var h = 0;
	
	//IE
	if(!window.innerWidth) {
		//strict mode
		if (!(document.documentElement.clientWidth == 0)) {
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		} else {//quirks mode
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	} else { //w3c
		w = window.innerWidth;
		h = window.innerHeight;
	}
	return {width: w, height: h};
}
